<a class="diy-gotop external" style="{if !empty($diygotop['params']['gotoptype'])}width: {$diygotop['style']['width']}px;{/if} position: fixed; overflow: hidden; z-index: 999; {if $diygotop['params']['iconposition']=='left bottom'}bottom: {$diygotop['style']['top']}px; left: {$diygotop['style']['left']}px; text-align: left;{elseif $diygotop['params']['iconposition']=='right bottom'}bottom: {$diygotop['style']['top']}px; right: {$diygotop['style']['left']}px; text-align: left;{/if} {if !empty($diygotop['params']['gotopheight'])}display:none;{/if}" {if !empty($diygotop['params']['gotopclick'])}href="{$diygotop['params']['linkurl']}"{else} id="gotop"{/if} >
    {if empty($diygotop['params']['gotoptype'])}
        <div style="background: {php echo empty($diygotop['style']['background'])?'#000000':$diygotop['style']['background']}; opacity: {php echo empty($diygotop['style']['opacity'])?'0.5':$diygotop['style']['opacity']}; line-height: {php echo $diygotop['style']['width']+2}px; text-align: center; border-radius: {$diygotop['style']['width']}px; height: {$diygotop['style']['width']}px; width: {$diygotop['style']['width']}px;">
            <i class="icon {php echo empty($diygotop['params']['iconclass'])?'icon-top1':$diygotop['params']['iconclass']}" style="color: {php echo empty($diygotop['style']['iconcolor'])?'icon-top1':$diygotop['style']['iconcolor']}; font-size: {php echo $diygotop['style']['width']-10}px;"></i>
        </div>
    {else}
        <img src="{php echo tomedia($diygotop['params']['imgurl'])}" style="height: auto; width: 100%; display: block;" />
    {/if}
</a>

{if empty($diygotop['params']['gotopclick'])}
<script>
    $(function () {
        {if !empty($diygotop['params']['gotopheight'])}
        $(".fui-content").bind('scroll resize', function () {
            var scrolltop = $(".fui-content").scrollTop();
            if (scrolltop > "{php echo intval($diygotop['params']['gotopheight'])}") {
                $("#gotop").fadeIn(100)
            } else {
                $("#gotop").fadeOut(100)
            }
        });
        {/if}
        $("#gotop").unbind('click').click(function () {
            $(".fui-content").animate({scrollTop: "0px"}, 1000)
        });
    });
</script>
{/if}